package jpa.entitys.promis.common;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the COST_PROJECT_ZONE database table.
 * 
 */
@Embeddable
public class CostProjectZonePK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(unique=true, nullable=false, length=30)
	private String company;

	@Column(unique=true, nullable=false, length=30)
	private String project;

	@Column(name="BUILDING_PHASE", unique=true, nullable=false, length=30)
	private String buildingPhase;

	@Column(name="ZONE_CODE", unique=true, nullable=false, length=30)
	private String zoneCode;

    public CostProjectZonePK() {
    }
	public String getCompany() {
		return this.company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	public String getProject() {
		return this.project;
	}
	public void setProject(String project) {
		this.project = project;
	}
	public String getBuildingPhase() {
		return this.buildingPhase;
	}
	public void setBuildingPhase(String buildingPhase) {
		this.buildingPhase = buildingPhase;
	}
	public String getZoneCode() {
		return this.zoneCode;
	}
	public void setZoneCode(String zoneCode) {
		this.zoneCode = zoneCode;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof CostProjectZonePK)) {
			return false;
		}
		CostProjectZonePK castOther = (CostProjectZonePK)other;
		return 
			this.company.equals(castOther.company)
			&& this.project.equals(castOther.project)
			&& this.buildingPhase.equals(castOther.buildingPhase)
			&& this.zoneCode.equals(castOther.zoneCode);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.company.hashCode();
		hash = hash * prime + this.project.hashCode();
		hash = hash * prime + this.buildingPhase.hashCode();
		hash = hash * prime + this.zoneCode.hashCode();
		
		return hash;
    }
}